package homework;

import java.util.Random;

public class homework09 {
	public static void main(String[] args) {
		int [][] arr={{1,2},{3,4,5,6,7},{8,9,10}};
		Random r = new Random();
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr[i].length;j++){
				int number1 = r.nextInt(arr.length);
				int number2=0;
				if(number1==0){
					number2 = r.nextInt(arr[0].length);
				}else if(number1==1){
					number2 = r.nextInt(arr[1].length);
				}else{
					number2 = r.nextInt(arr[2].length);
				}
				int temp=arr[i][j];
				arr[i][j]=arr[number1][number2];
				arr[number1][number2]=temp;	
			}
		}
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr[i].length;j++){
				System.out.print(arr[i][j]+" ");
			}
			System.out.println();
		}
	}
}
